package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 *
 * 配置类
 * @author : zjj
 * @date : 2021/6/15 17:04
 */


@Configuration
public class ConfigBean {

    /**
     * LoadBalanced注解,表示使用Ribbon的负载均衡
     * @return      返回restTemplate
     */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate()
    {
        return new RestTemplate();
    }
}

